
(require 'init-flymake)

;==============================================
; python
;;
(require 'python-mode)
(setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist (cons '("python" . python-mode) interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python editing mode." t)

(setq-default py-indent-offset 4)

;; my compile
(defun my-compile ()
  "Use compile to run python programs"
  (interactive)
  (compile (concat "python " (buffer-name))))
(setq compilation-scroll-output t)
;; (add-hook 'python-mode-hook
;;  (lambda ()
;;  (local-set-key (kbd "<f5>") 'my-compile)
;;  )
;; )
(global-set-key (kbd "<f5>") 'my-compile)


;; pdb setup, note the python version
(setq pdb-path 'c:/python27/Lib/pdb.py
      gud-pdb-command-name (symbol-name pdb-path))
(defadvice pdb (before gud-query-cmdline activate)
  "Provide a better default command line when called interactively."
  (interactive
   (list (gud-query-cmdline pdb-path
                            (file-name-nondirectory buffer-file-name)))))

;; check the py error when editing with flymake
(require 'flymake-python-pyflakes)
(add-hook 'python-mode-hook 'flymake-python-pyflakes-load)


;;=============================================
;; lua
(setq auto-mode-alist (cons '("\\.lua$" . lua-mode) auto-mode-alist))
(autoload 'lua-mode "lua-mode" "Lua editing mode." t)

;;=============================================
;; LaTex
;; 
;; (load "AucTeX.el" nil t t)
 ;; (load "preview-latex.el" nil t t)
 ;; (if (string-equal system-type "windows-nt")
 ;;     (require 'tex-mik))
 ;; (setq TeX-auto-save t)
 ;; (setq TeX-parse-self t)
 ;; (setq-default TeX-master nil)

;;=============================================
;; Org-mode
;; 
(setq org-hide-leading-stars t) 
(define-key global-map "\C-ca" 'org-agenda) 
(setq org-log-done 'time)
